<template>
  <el-pagination
    class="normal-pagination"
    :current-page="currentPage"
    :page-size="pageSize"
    :total="total"
    :page-sizes="pageSizeList"
    :background="isBackGround"
    :layout="layout"
    :pager-count="pagerCount"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  ></el-pagination>
</template>

<script>
export default {
  name: 'NormalPagination',
  props: {
    currentPage: {
      type: Number,
      default: 1
    },
    pageSize: {
      type: Number,
      default: 20
    },
    pageSizeList: {
      type: Array,
      default: () => [20, 30, 50]
    },
    total: {
      type: Number,
      default: 0
    },
    layout: {
      type: String,
      default: 'total,sizes,prev,pager,next,jumper'
    },
    isBackGround: {
      type: Boolean,
      default: true
    },
    pagerCount: {
      type: Number,
      default: 7
    },
  },
  data() {
    return {}
  },
  methods: {
    handleSizeChange(val) {
      this.$emit('handleSizeChange', val);
    },
    handleCurrentChange(val) {
      this.$emit('handleCurrentChange', val);
    },
  }
}
</script>

<style lang="scss" scoped>
.normal-pagination {
  text-align: right;
  height: 40px;
  margin-top: 15px;
}
</style>
